import { lazy } from 'react';

export const mainRoute = [
    {
        path:'/Home/Index',
        element:lazy(()=>import('../Page/Home/Index')),
        txt:'书架'
    },
    {
        path:'/Home/JingX',
        element:lazy(()=>import('../Page/Home/JingX')),
        txt:'精选'
    },
    {
        path:'/Home/Sort',
        element:lazy(()=>import('../Page/Home/Sort')),
        txt:'排行'
    },
    {
        path:'/Home/Classify',
        element:lazy(()=>import('../Page/Home/Classify')),
        txt:'分类'
    },
    
]

const routes =[
    {
        path:'/Home',
        element:lazy(()=>import('../Page/Home')),
        children:mainRoute
    },
    {
        path:'/Detail/:id',
        element:lazy(()=>import('../Page/Detail'))
    },
    {
        path:'/Login',
        element:lazy(()=>import('../Page/Login'))
    },
    {
        path:'/Reading',
        element:lazy(()=>import('../Page/Reading'))
    },
    {
        path:'*',
        element:lazy(()=>import('../Page/Erroy404'))
    },
    {
        path:'/',
        to:'/Home/Index'
    }
]

export default routes;